perfc_incrc(calls_to_mmu_update);
perfc_addc(num_page_updates, count);
/*
- * do a histogram for count.
- * first bucket is for count=0,
- * second bucket is for count=1
- * last bucket is for count >= 63 * PERFC_PT_UPDATES_BUCKET_SIZE
+ * histogram: special treatment for 0 and 1 count. After that equally
+ * spaced with last bucket taking the rest.
*/
if ( count == 0 )
{
} else if ( count == 1 )
{
perfc_incra(bpt_updates, 1);
- } else if ( (count / PERFC_PT_UPDATES_BUCKET_SIZE)
+ } else if ( ((count-2) / PERFC_PT_UPDATES_BUCKET_SIZE)
< (PERFC_MAX_PT_UPDATES - 3) )
{
- perfc_incra(bpt_updates, (count / PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
+ perfc_incra(bpt_updates, ((count-2)/PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
} else
{
perfc_incra(bpt_updates, PERFC_MAX_PT_UPDATES - 1);
#ifdef PERF_COUNTERS
/*
- * do a histogram for count.
- * first bucket is for count=0,
- * second bucket is for count=1
- * last bucket is for count >= 63 * PERFC_PT_UPDATES_BUCKET_SIZE
+ * histogram: special treatment for 0 and 1 count. After that equally
+ * spaced with last bucket taking the rest.
*/
if ( count == 0 )
{
} else if ( count == 1 )
{
perfc_incra(wpt_updates, 1);
- } else if ( (count / PERFC_PT_UPDATES_BUCKET_SIZE)
+ } else if ( ((count-2) / PERFC_PT_UPDATES_BUCKET_SIZE)
< (PERFC_MAX_PT_UPDATES - 3) )
{
- perfc_incra(wpt_updates, (count / PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
+ perfc_incra(wpt_updates, ((count-2)/PERFC_PT_UPDATES_BUCKET_SIZE) + 2);
} else
{
perfc_incra(wpt_updates, PERFC_MAX_PT_UPDATES - 1);
*/
#include <xen/sched.h>
+#include <xen/config.h>
#define DEFINE(_sym, _val) \
__asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
- OFFSET(PERFC_hypercalls, struct perfcounter_t, hypercalls);
- OFFSET(PERFC_exceptions, struct perfcounter_t, exceptions);
+#if PERF_COUNTERS
+ OFFSET(PERFC_hypercalls, struct perfcounter, hypercalls);
+ OFFSET(PERFC_exceptions, struct perfcounter, exceptions);
+#endif
}